<ul class="breadcrumb">
	<li>
		<a href="<?= site_url('founder/goals')?>">
			Objectives
		</a>
		<span class="divider">
			/
		</span>
	</li>
	<li class="active">		
			<?php echo $objec['title']?>		
	</li>	
</ul>
<h3>
	Goal Details of
</h3>
<?php

?>
<div id="contentLeft">
	<ul class="ui-sortable" style="list-style:none;margin:0;">
		<?php
		foreach($goals as $goal){
			$startDate = strtotime(date('Y-m-d'));
			$endDate   = strtotime($goal->due_date);
			$due_date  = date('d', $endDate) - date('d', $startDate);
			if($due_date < 0){
				$due_date_title = '<strong>Overdue by </strong> <span class="badge badge-important">'.$due_date.'</span> days';
			}
			else
			{
				$due_date_title = '<strong>Due by </strong><span class="badge badge-success">'.$due_date.'</span> days';
			}

			?>
			<li>

				<div class="row-fluid">

					<div class="span5">
						<span class="handler" style="cursor:move;">
						</span>
						<a href="<?= site_url('founder/goals/results/'.$goal->id)?>" rel="tooltip" title="asd" class="tooltips">
							<strong>
								<?= $goal->title;?>
							</strong>
						</a>
					</div>
					<div class="span4">
						<div class="progress progress-success  progress-striped">
							<div class="bar" style="width: <?php echo $goal->completed_percentage ?> % ">
							</div>
						</div>
					</div>
					<div class="span2">
						<?= $due_date_title?>
					</div>
					<div class="span1">

					</div>
				</div>
			</li>
			<?php
		}?>
	</ul>
</div>


<script type="text/javascript">

	$(document).ready(function(e)
		{
			// drag n drop
			jQuery(function()
				{
					//alert("asdds");
					jQuery("#contentLeft ul").sortable(
						{
							opacity: 0.6, cursor: 'move',  update: function()
							{
								var order = jQuery(this).sortable("serialize") + '&action=updateRecordsListings';
								//	alert(order);
								jQuery.post("<?= site_url('');?>", order, function(theResponse)
									{
										//alert(theResponse);
									});
							}
						});
				});

		});

</script>